package com.dvt.faceScan.httpUntil;
import android.util.Log;
import com.dvt.faceScan.widget.Config;
import java.util.Arrays;
import java.util.HashMap;
import java.util.concurrent.Callable;

import static com.dvt.faceScan.httpUntil.XmlRpcUtils.authenticate;

/**
 * Created by XGJ on 2018/3/27.
 * 调登录方法线程
 */
public class requestThread implements Callable<String> {
    public String call() throws Exception{
       String request_login =null;
        try {
            String url = String.format("%s/xmlrpc/2/common", Config.baseURL);
          int uid = XmlRpcUtils.authenticate(url, Arrays.asList(Config.DB,Config.account,Config.password,new HashMap<String,Object>()));
          request_login= Integer.toString(uid);
         Log.d("uid",request_login+"");
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }
        return request_login;
    }
}
